class CreateOrders < ActiveRecord::Migration[5.2]
  def change
    create_table :orders do |t|
      t.string :trade_no
      t.integer :shop_id
      t.integer :user_id
      t.integer :state, default: 0
      t.decimal :total_fee, :precision => 10, :scale => 2, :default => 0.0
      t.string :buyer_phone
      t.string :buyer_name
      t.string :address
      t.decimal :express_fee, :precision => 10, :scale => 2, :default => 0.0
      t.string :mix_trade_no
      t.integer :logistics_company_id
      t.string :logistics_trade_no
      t.boolean :need_express, default: true
      t.boolean :is_evaluated, default: false
      t.integer :pay_method, default: 0
      t.string :refund_no
      t.decimal :coupon_fee, :precision => 10, :scale => 2, :default => 0.0

      t.timestamps
    end
  end
end
